package org.ajc;

import org.ajc.auth.interceptors.AuthInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 主启动类
 */
@SpringBootApplication
@MapperScan("org.ajc.*.mapper")
//@ServletComponentScan("org.ajc.base.listener")  // 扫描器
public class PlatFormAppStart implements WebMvcConfigurer {
    public static void main(String[] args) {
        SpringApplication.run(PlatFormAppStart.class,args);
    }

//    @Autowired
//    private AuthInterceptor authInterceptor;
//
//    @Override
//    public void addInterceptors(InterceptorRegistry registry) {
//        registry.addInterceptor(authInterceptor)
//                .addPathPatterns("/**")   // 这是全部拦截
//                .excludePathPatterns("/login","loginOut"); // 这是需要放行什么
//        // 注意：前后端分离不管什么静态资源，静态资源在前端
//    }
}
